package com.example.yiwei.crm.view.activity.jtCustomer;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.yiwei.crm.R;
import com.example.yiwei.crm.data.GetAppointment;
import com.example.yiwei.crm.data.GetCustumer;
import com.example.yiwei.crm.entity.ApointmentEntity;
import com.example.yiwei.crm.entity.CustomerMessageEntity;

public class DetaileSeacherYYActivity extends AppCompatActivity {
    private TextView tv_name,tv_yynumber,tv_sex,tv_age,tv_bz,tv_phone,tv_province,tv_city,tv_area,tv_yy_time,
    tv_yyhospital,tv_yyks,tv_state,tv_jz_time,tv_jz_ks,tv_qdfl,tv_qdly,tv_bm,tv_dj,tv_yypeople,tv_ctime,tv_qrtime;
    private ApointmentEntity apo;
    private CustomerMessageEntity customer;
    private ImageView back;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_detaile_seacher_yy);
        tv_name = (TextView) findViewById(R.id.customer_appointment_txt_name);
        back = (ImageView) findViewById(R.id.customerAppointmentMessage_img_back);
        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        tv_yynumber = (TextView) findViewById(R.id.customer_appointment_txt_appointment_number);
        tv_sex = (TextView) findViewById(R.id.customer_appointment_sex);
        tv_age = (TextView) findViewById(R.id.customer_appointment_txt_age);
        tv_bz = (TextView) findViewById(R.id.customer_appointment_txt_disease);
        tv_phone = (TextView) findViewById(R.id.customer_appointment_txt_phone);
        tv_province = (TextView) findViewById(R.id.customer_appointment_txt_province);
        tv_city = (TextView) findViewById(R.id.customer_appointment_txt_city);
        tv_area = (TextView) findViewById(R.id.customer_appointment_txt_are);
        tv_yy_time = (TextView) findViewById(R.id.customer_appointment_txt_time);
        tv_yyhospital = (TextView) findViewById(R.id.customer_appointment_txt_hospital);
        tv_yyks = (TextView) findViewById(R.id.customer_appointment_txt_department);
        tv_state = (TextView) findViewById(R.id.customer_appointment_txt_state);
        tv_jz_time = (TextView) findViewById(R.id.customer_appointment_txt_jz_time);
        tv_jz_ks = (TextView) findViewById(R.id.customer_appointment_txt_jz_ks);
        tv_qdfl = (TextView) findViewById(R.id.customer_appointment_txt_qdfl);
        tv_qdly = (TextView) findViewById(R.id.customer_appointment_txt_qdly);
        tv_bm = (TextView) findViewById(R.id.customer_appointment_txt_bm);
        tv_dj = (TextView) findViewById(R.id.customer_appointment_txt_dj);
        tv_yypeople = (TextView) findViewById(R.id.customer_appointment_txt_yuyueren);
        tv_ctime = (TextView) findViewById(R.id.customer_appointment_txt_ctime);
        tv_qrtime = (TextView) findViewById(R.id.customer_appointment_txt_qetime);
        apo = GetAppointment.apoint;
        customer = GetCustumer.customers;
        tv_name.setText(customer.getClient_name());
        tv_yynumber.setText(apo.getAppointment_number());
        if (customer.getClient_gender()==1){
            tv_sex.setText("男");
        }
        if (customer.getClient_gender()==2){
            tv_sex.setText("女");
        }
        tv_age.setText(customer.getClient_gender()+"");
        tv_bz.setText(customer.getDisease_category());
        tv_phone.setText(customer.getContact_phone_number());
        tv_province.setText(customer.getPname());
        tv_city.setText(customer.getCname());
        tv_area.setText(customer.getAname());
        tv_yy_time.setText(apo.getAppoint_date());
        tv_yyhospital.setText(apo.getAppoint_hospital());
        tv_yyks.setText(apo.getAppint_department());
        if (apo.getAppointment_state()==0){
            tv_state.setText("预约");
        }
        if (apo.getAppointment_state()==1){
            tv_state.setText("初诊");
        }
        if (apo.getAppointment_state()==2){
            tv_state.setText("复诊");
        }
        tv_jz_time.setText(apo.getTriage_date());
        tv_jz_ks.setText("");
        tv_qdly.setText(customer.getChannel_source());
        tv_qdfl.setText(customer.getChannel_classification());
        tv_bm.setText(customer.getBelongs_department());
        if (1==apo.getDj_state()){
            tv_dj.setText("作废");
        }else {
            tv_dj.setText("正常");
        }
        tv_yypeople.setText(apo.getYy_name());
        tv_ctime.setText(apo.getCreate_time());
        tv_qrtime.setText(apo.getQr_time());
    }
}
